home *** CD-ROM | disk | FTP | other *** search
/ Aminet 19 / Aminet 19 (1997)(GTI - Schatztruhe)[!][Jun 1997].iso / Aminet / comm / cnet / revive.lha / revive / ReVive next >
Text File  |  1997-04-05  |  11KB  |  179 lines

  1. /**************************************************************************\
  2.                 $VER: ReVive, v3.02 (5-Apr-97) by Dotoran!
  3. \**************************************************************************/
  4. options results;signal on SYNTAX;signal on ERROR;signal on IOERR;call IERROR
  5. a=sourceline(2);parse var a . ", "ver" ("vdate")" .
  6. tr=transmit;se=sendstring;gc=getchar;gu=getuser;gs=getscratch;call RSDATA
  7. a="rexxsupport.library";if ~show("l",a) then if ~addlib(a,0,-30) then exit
  8. parse source . . fp .;df=left(fp,max(lastpos('/',fp),lastpos(':',fp)))
  9.  
  10. users2="DH0:ReVive/"   
  11.                 /* Path to create/store the "users2/" directory. This path
  12.                    needs to END with either a slash (/) or a colon (:). It
  13.                    is HIGHLY RECOMMENDED this location be on a different
  14.                    PHYSICAL drive than that which houses your MAIL:USERS/
  15.                    directory for maximum benefit of ReVival ability!      */
  16.  
  17. START:
  18.   gu 2400088;acts=result;gu 1202244;args=result-1;zz="00"x;changewhere "Playing God!"
  19.   if args>0 then do;a="";do i=0 to args-1;gu 1302307+(i*61);a=a||result" ";end i
  20.     tot=PARSE(a,1,acts);signal REVIVE2;end
  21.   call TITLE;se "n1c6Want Instructions? c7[cbNoc7]c9: ";gc;a=result
  22.   if a="Y" then do;tr "caYesc6!";signal DOCS;end;else tr "cbNoc6."
  23.  
  24. REVIVE:
  25.   se "n1cbReVive c6Which cbID c6Numberc7(c6sc7)c6? c7[caSc6=caScanc6/cdQc6=cdQuitc7]c9: cbi0 30}"
  26.   gu 70;a=result;if (upper(a)="Q"|a=""|a<1|a>acts)&upper(a)~="S" then exit
  27.   if upper(a)="S" then a="";tot=PARSE(a,1,acts)
  28.   if tot=0 then do;se "n1c6Scanningc9: c7[cd0000c7]<5";tot=0;it.=""
  29.     do i=1 to acts;loadscratch i;st=result;savescratch (-i)
  30.       getscratch 1;handle=result;se "cd"right("cb"i,7,"0")"<4"
  31.       if handle="!" then do;tot=tot+1;it.tot=i;it.0=it.0" "it.tot;end
  32.     end i;tr ">6c9Finishedc6!"
  33.     if tot=0 then tr "n1c9No c9Deleted c6Accounts Found!"
  34.       else tr "n1c9Deleted cbID c6Numbersc9: cb"it.0
  35.     signal REVIVE;end
  36.  
  37. REVIVE2:
  38.   pointers=0
  39.   do i=1 to tot
  40.     tr "f1caAttempting c6to cbReVive cfID # cc: ca"it.i
  41. /**/;z=forbid()
  42.     call open(f1,df"ReViveDB","r")
  43.       index=((it.i*38)-38)+4 ; call seek(f1,index,"b")
  44.       uid=translate(strip(readch(f1,4),"t",zz),reverse(bb),bb)
  45.       handle=translate(strip(readch(f1,20),"t",zz),reverse(bb),bb)
  46.       password=translate(strip(readch(f1,14),"t",zz),reverse(bb),bb)
  47.     call close(f1)
  48. /**/;z=permit()
  49.     if handle="!" then handle="REVIVE"it.i
  50.     if password=d2c(1) then password="REVIVE"it.i
  51.     if uid="SID" then uid=it.i
  52.     loadscratch it.i;getscratch 1;handle2=result
  53.     getscratch 3;realname=result;getscratch 6;street=result
  54.     getscratch 4;citystate=result;getscratch 5;zipcode=result
  55.     getscratch 9;voice=result;getscratch 10;data=result
  56.     getscratch 11;lastcall=result;getscratch 39;maildir=result
  57.     getuser 1100000;year=result;getuser 1100001;month=result
  58.     getuser 1100002;day=result
  59.     if handle2~="!" then do
  60.       tr "n1c6This is c9NOT c6a cbdeleted c6account!n1"
  61.       tr "c6User's Handle    c9: ca"handle2
  62.       tr "c6User's Real Name c9: cb"realname
  63.       tr "c6User's Password  c9: cd"password
  64.       tr "n1c7Press cdany key c7now...g1"
  65.       savescratch (-it.i);iterate i;end
  66.     tr "n1r1caData Found Inside Account r0cc:n1"
  67.     tr "c2     User's Real Name     cc: c2"realname
  68.     tr "ca     Street Address       cc: ca"street
  69.     tr "c2     City, State Zip      cc: c2"citystate" "zipcode
  70.     tr "ca     Voice Phone Number   cc: ca"voice
  71.     tr "c2     Data  Phone Number   cc: c2"data
  72.     tr "ca     Last Call Date/Time  cc: ca"lastcall
  73.     tr "n1r1cbData From ReVive Database r0cc:n1"
  74.     tr "cd     Unique Serial Number cc: cd"uid
  75.     tr "c5     User's Handle        cc: c5"handle
  76.     tr "cd     User's Password      cc: cd"password
  77.     se "n1   c6If the data from the cadatabase c6coincides with the existing "
  78.     se "data in the cbactual user accountc6, then it's caOK c6to cbReVive c6this "
  79.     se "account, but if the data in the account does c9NOT c6reflect the "
  80.     se "cfproper c6data for the c9DELETED c6user, then you should c9NOT c6attempt "
  81.     tr "to cbReVive c6this account.n1@4"
  82.     se "c6Should I cbReVive c6this account now? c7[cbNoc7]c9: ";gc;a=result
  83.     if a~="Y" then do;tr "cbNoc6.";savescratch (-it.i);iterate i;end
  84.     se "caYesc6, cbReVivingc6...";pointers=1
  85.     address command "makedir mail:users/"maildir
  86.     setobject handle;putscratch 1
  87.     setobject password;putscratch 2
  88.     setobject uid;putscratch 41
  89.     setobject year;putscratch 1101094
  90.     setobject month;putscratch 1101095
  91.     setobject day;putscratch 1101096
  92.     savescratch it.i;tr "h6cbedc6!"
  93.     inuse=inuse+1;call SSDATA
  94.     if exists(users2"users2/"maildir) then do
  95.       se "n1cbReVive ca"handle"'s ceUUCP Mail Directory c6too? c7[caYesc7]c9: "
  96.       gc;a=result;if a="N" then tr "cbNoc6.";else do;se "caYesc6, cbReVivingc6..."
  97.         address command "copy "users2"users2/"maildir"/ mail:users/"maildir"/ all"
  98.         tr "h6cbedc6!";end;end
  99.   end i
  100.   logentry "cbReVived "handle"'s Account...q1" ; if pointers=0 then exit
  101.   se "n1   c6To finish up, it will be necessary to run the caPOINTERS c6program "
  102.   tr "to cdreactivate c6the cbReVived ceHandles c6used...n1"
  103.   fp="doors:pointers";addkeys (fp)
  104.   se "c6Enter cfpath c6to cbPointers c6filec9: r1cai0 50}r0c9";gu 70;fp=result
  105.   if ~exists(fp) then do;se "n1c6I was c9NOT c6able to locate the file cf`ca"fp"cf'c6... You'll have to run "
  106.     se "it manually. Do so c9right nowc6, else your system won't recognize the "
  107.     tr "cbReVived c6handle(s) until such a time as you cfDO c6run cbPointersc6!";exit;end
  108.   tr "#2 "fp"}n1cbReViving c6is cacompletec6!"
  109. exit
  110.  
  111. PARSE: procedure expose it.; arg rng,min,max
  112.    it.='';c=0;it=translate(rng,'  ','.,')
  113.     do a=1 to words(it);c=c+1;it.c=word(it,a)
  114.         if index(it.c,'-')>0 then do;parse var it.c x'-'y
  115.         if y='' then y=max;if x='' then x=min
  116.         if x>y then do;d=x;x=y;y=d;end
  117.         if x<min|y>max|~datatype(x,'W')|~datatype(y,'W') then do;c=c-1;iterate;end
  118.         do b=x to y;it.c=b;c=c+1;end;c=c-1;end
  119.     else if it.c<min|it.c>max|~datatype(it.c,'W') then do;c=c-1;iterate;end;end
  120.     do i=1 to c;it.0=it.0||it.i' ';end
  121.   return c
  122.  
  123. TITLE:;tr 'f1ÀÄ¿'
  124.   tr '  À¿ ÚÄ¿   ÚÄÄ¿CÛßßßÜCÛ    Û ÜCÜßßßÜ    ÜßßßÜ ÜßßßÜ'
  125.   tr 'ÚÄÄÙ ³ ÀÄÄÄÙÚÄÁ¿CÛÜÜÜß ÜßßÜ Û    Û Ü Û   Û ÜßßÜCÜÜß    Û   Û   ÜÜß'
  126.   tr 'ÀÄ¿ ÚÙ ÜÜÛÛÛ³ÜÜÀ¿    Û   Û Ûßß   Û  Û  Û ßÜ Üß ÛßßCÜ   Û    Û   Û Üß'
  127.   tr '  ³ ³ ÛÛß   ÀßÛÛÙ    ß   ß  ßßß   ßß   ß   ß    ßßßCßßß   ß  ßßß  ßßßßß'
  128.   tr ' ÚÙÚÙ ÛÛCÛÛ  ÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛ'
  129.   tr ' ³ ³  ßÛÛÜÜÜÜÛÛß  Û  Another lifesaving utility from Dotoran of Frontiers  Û'
  130.   tr ' ÀÄÙCßßßßCÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ'
  131.  return
  132.  
  133. DOCS:;tr "f1cbReVivec6, cf"ver" cdDocumentation cf- c6Page cb1 c7(c6of cb2c7)n1"
  134.   se "c6   When a user account is c9deleted c6in caCNet Amiga, v3.05c c6or cav4.26bc6, it's not "
  135.   tr "caactually c9deletedc6, but cbslightly modifiedc6.n1"
  136.   se "   There are cdfour c6major pieces of information that are c9LOST c6during "
  137.   se "this processc9: caunique serial id numberc6, cbuser handlec6, cduser passwordc6, "
  138.   tr "and the ceuser's uucp mail directoryc6.n1"
  139.   se "   cbReVivec6, cf"ver" c6keeps a constantly updated cadatabase c6containing the "
  140.   se "first cathree c6pieces of information listed above, so that if you ever "
  141.   se "wish to cd`cbrevivecd' c6one of these c9deleted c6accounts, you'll have copies "
  142.   se "of the camost recent information c6from these accounts to recreate the "
  143.   se "user account with. A new ceuucp mail directory c6will also be created "
  144.   se "for this user, as well as their cdlast call date c6being updated to "
  145.   tr "reflect the cfcurrent datec6.n1"
  146.   se "   Starting with cfv2.20c6, it is possible to specify cfranges c6"
  147.   se "of id numbers you wish to cd`cbrevivecd'c6, so you may wish to initially hit "
  148.   se "your caENTER c6key to scan ceALL c6user accounts, then review each c9deleted c6"
  149.   tr "account to see if it should be cd`cbrevivedcd' c6or not.n1"
  150.   se "c7Press ccany key c7to continue...g1"
  151.   tr "f1cbReVivec6, cf"ver" cdDocumentation cf- c6Page cb2 c7(c6of cb2c7)n1"
  152.   se "c6   Also starting with cfv2.20c6, the caneed to directly modify c6the "
  153.   se "values stored in the cd`cebbs.sdatacd' c6file is c9NOT c6needed. Because of "
  154.   se "this, it is cfno longer neccessary c6for you to reboot the computer "
  155.   tr "after reviving user accounts.n1"
  156.   se "   If enabled, you may also be asked if you wish to cd`cbrevivecd' c6a "
  157.   se "user's ceuucp directory's cfCONTENTS c6from a backup as well. Presently, "
  158.   se "an cbexact duplicate c6of your cd`cbmail:users/cd' c6directory can be maintained "
  159.   se "in your cd`ce"users2"cd' c6directory which contains the camost up to date c6"
  160.   tr "contents of said directories.n1"
  161.   tr "c7Press ccany key c7to start cbReVivec7, cf"ver"c7...g1"
  162.  signal REVIVE
  163.  
  164. RSDATA:;call open(f1,"SysData:bbs.sdata","r")
  165.   do i=1 to 5;vd.i=c2d(readch(f1,4));end i;call close(f1);inuse=vd.2;return
  166.  
  167. SSDATA:;vd.2=inuse;setobject vd.2;putuser 2400092
  168.   call open(f2,"SysData:bbs.sdata","w");do ii=1 to 5
  169.   call writech(f2,d2c(vd.ii,4));end ii;call close(f2);return
  170.  
  171. IERROR:;bb="`~!@#$%^&*()_-+=|\abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ[]{};':"d2c(34)",./<>?";return
  172. SYNTAX:;ERROR:;IOERR:;e1="n1 Error: "rc" ("errortext(rc)")"
  173.   e2="  Line: "left(sigl,4)"File:";c="`"fp", "ver"'";e2=e2" "c;tr e1;tr e2
  174.   logentry e1;logentry e2;e=strip(translate(sourceline(sigl),"\{",""))
  175.   do while e~="";e3="Source: "left(e,37);tr e3;logentry e3;e=substr(e,38);end
  176.   bufferflush;exit
  177. /**************************************************************************\
  178. \****************************************** Frontiers BBS (716)/823-9892 **/
  179.